package com.geeguo.ebuilder.client.business.system.role.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.geeguo.ebuilder.client.business.system.role.model.RoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Map;
import java.util.Set;

@Mapper
public interface RoleMapper extends BaseMapper<RoleEntity> {

    IPage<RoleEntity> list(IPage<RoleEntity> page, @Param("params") Map<String, Object> params);
    
    RoleEntity getByCode(@Param("code") String code, @Param("tenantCode") String tenantCode);

    RoleEntity getByName(@Param("name") String name, @Param("tenantCode") String tenantCode);

    Integer updateByParams(@Param("params") Map<String, Object> changeValues);
    Integer isUsed(@Param("id") String id);

    Set<String> listIdByUser(String userId);
    Set<String> listCodeByUser(String userId);
}